package com.nageoffer.shortlink.admin.controller;


import com.nageoffer.shortlink.admin.common.result.Result;
import com.nageoffer.shortlink.admin.romote.ShortLinkRemoteService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * URL标题控制层
 */
@RestController
@RequiredArgsConstructor
public class UrlTitleController {

    ShortLinkRemoteService shortLinkRemoteService = new ShortLinkRemoteService(){};


    @GetMapping("/api/short-link/admin/v1/title")
    public Result<String > getTitleByUrl(@RequestParam("url") String url) throws Exception{
        return shortLinkRemoteService.getTitleByUrl(url);
    }

}
